﻿<%@ Page Title="" Language="C#" MasterPageFile="~/SkillifyMaster.master" AutoEventWireup="true" CodeFile="ManageAssignment.aspx.cs" Inherits="ManageAssignment" %>

<%@ Register src="~/UserControls/UserSelection.ascx" tagname="UserSelection" tagprefix="uc1" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">

    <style type="text/css">
        .style4
        {
            width: 577px;
        }
        .style5
        {
            width: 577px;
            height: 48px;
        }
        .style6
        {
            height: 48px;
        }
        .style7
        {
            width: 577px;
            height: 42px;
        }
        .style8
        {
            height: 42px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <table width="100%">

        <tr>
           <%-- <td align="right" width="20%">
            </td>--%>
            <td align="right">
                <h2><asp:Label ID="lablManageAss" runat="server" Text="Manage Assignment"></asp:Label></h2>
            </td>
        </tr>

        <tr>
            <td>
                <table align="left" cellspacing="5" style="border: 4px outset orange;" width="100%">
                    <tr>
                        <td class="style7">
                            <asp:Button ID="btnNext" runat="server" 
                                Text="Create Assignment" BackColor="#E49642" BorderColor="#CC7A24" 
                                ForeColor="White" PostBackUrl="~/Admin/CreateAssignment.aspx" 
                                CausesValidation="False" />
                        </td>

                        <td class="style8">
                        </td>
                    </tr> 

                    <tr>
                        <td class="style5">
                             <asp:Label ID="lablSubj" runat="server" Text="Subject"></asp:Label> &nbsp;&nbsp;
                                 <asp:DropDownList ID="ddlSub" runat="server" AutoPostBack="True" 
                                    Width="220px" onselectedindexchanged="ddlSub_SelectedIndexChanged">
                                </asp:DropDownList>

                                &nbsp;
                                <asp:CompareValidator ID="compSub" runat="server" ControlToValidate="ddlSub" 
                                    ErrorMessage="Please Select One subject" ForeColor="Red" Operator="NotEqual" 
                                    ValueToCompare="--Select One--">*</asp:CompareValidator>

                                &nbsp;&nbsp;&nbsp;&nbsp;
                                <asp:Label ID="lablTopics" runat="server" Text="Topic"></asp:Label>&nbsp;&nbsp;
                                <asp:DropDownList ID="ddlTopic" runat="server" Width="220px">
                                </asp:DropDownList>
                                 
                        </td>

                        <td class="style6">
                            <asp:Label ID="lablStatus" runat="server" Text="status"></asp:Label>
                            &nbsp;&nbsp;&nbsp;&nbsp;
                            <asp:DropDownList ID="ddlStatus" runat="server" Width="220px">
                                <asp:ListItem Value="0">All</asp:ListItem>
                                <asp:ListItem>Parked</asp:ListItem>
                                <asp:ListItem>Scheduled</asp:ListItem>
                                <asp:ListItem>InProgress</asp:ListItem>
                                <asp:ListItem>Completed</asp:ListItem>
                                <asp:ListItem>Pending</asp:ListItem>
                            </asp:DropDownList>
                        </td>
                    </tr>

                    <tr>
                        <td class="style4">
                            

                        </td>

                        <td>
                            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                            <asp:Button ID="btnShow" runat="server" Text="Show Assignment" 
                                 BackColor="#E49642" 
                                BorderColor="#CC7A24" ForeColor="White" onclick="btnShow_Click" />
                                &nbsp;&nbsp;&nbsp;&nbsp;
                                 <asp:Button ID="ClearRecord" runat="server" Text="Clear search" 
                                CausesValidation="False" BackColor="#E49642" 
                                BorderColor="#CC7A24" ForeColor="White" onclick="ClearRecord_Click"  />
                        </td>
                    </tr>

                   

                   <tr>
                        
                        <td class="style4">
                            <asp:Label ID="lablError" runat="server" ForeColor="Red"></asp:Label>
                            <asp:ValidationSummary ID="valSummSub" runat="server" ForeColor="Red" />
                        </td>

                        <td>
                        </td>
                       
                    </tr>
                </table>
            </td>
        </tr>

        <tr>
            <td>
                <table align="left" width="100%">
                    <tr>
                        <td align="left" valign="top">
                            <asp:GridView ID="gvAssignment" runat="server" AutoGenerateColumns="False" 
                    BackColor="LightGoldenrodYellow" 
                                BorderColor="Tan" BorderWidth="1px" 
            CellPadding="2" ForeColor="Black" GridLines="Vertical" DataKeyNames="AssignmentId,States" 
                               Width="930px" onpageindexchanging="gvAssignment_PageIndexChanging" 
                                onselectedindexchanged="gvAssignment_SelectedIndexChanged" 
                                onrowcommand="gvAssignment_RowCommand">
            <AlternatingRowStyle BackColor="PaleGoldenrod" />
                    <Columns>
                            <asp:ButtonField ButtonType="Link" CommandName="Select" 
                                DataTextField="AssignmentId" HeaderText="Id" SortExpression="AssignmentId" 
                                ItemStyle-Font-Underline="true" >
<ItemStyle  Font-Underline="True"></ItemStyle>
                            </asp:ButtonField>
                            <asp:BoundField DataField="AssignmentName" HeaderText="Name" 
                                SortExpression="AssignmentName" />
                            <asp:BoundField DataField="SubjectName" HeaderText="Subject" 
                                SortExpression="SubjectName" />
                            <asp:BoundField DataField="TopicName" HeaderText="Topic" 
                                SortExpression="TopicName" >
                            </asp:BoundField>
                            <asp:BoundField DataField="StartDate" HeaderText="StartDate" 
                                SortExpression="StartDate" />
                            <asp:BoundField DataField="EndDate" HeaderText="EndDate" 
                                SortExpression="EndDate" />
                            <asp:BoundField DataField="States" HeaderText="Status" 
                                SortExpression="Status" />
                            <asp:TemplateField>
                                <HeaderTemplate>
                                    <asp:Label ID="lablManage" runat="server" Text="Action"></asp:Label>
                                </HeaderTemplate>
                                <ItemTemplate>
                                    <asp:LinkButton ID="linkViewAss" runat="server" Font-Underline="true" CommandName="btnLinkClick" CommandArgument='<%# Eval("AssignmentId") %>'>Manage</asp:LinkButton>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField>
                                <HeaderTemplate>
                                    <asp:Label ID="lablRank" runat="server" Text="Rank"></asp:Label>
                                </HeaderTemplate>
                                <ItemTemplate>
                                    <asp:LinkButton ID="linkRank" runat="server" Font-Underline="true" CommandName="btnLinkRankClick" CommandArgument='<%# Eval("AssignmentId") %>'>Rank</asp:LinkButton>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField>
                                <ItemTemplate>
                                    <asp:Button ID="btnCopy" runat="server" Text="Copy" BackColor="#E49642" BorderColor="#CC7A24" ForeColor="White"
                                    CommandName="btnCopyClick" CommandArgument='<%# Eval("AssignmentId") %>' />
                                </ItemTemplate>
                            </asp:TemplateField>
                        </Columns>
                        <EditRowStyle HorizontalAlign="Center" VerticalAlign="Middle" />
            <EmptyDataRowStyle HorizontalAlign="Center" VerticalAlign="Middle" />
         <FooterStyle BackColor="Tan" />
            <HeaderStyle BackColor="#CB6811" Font-Bold="True" ForeColor="White" HorizontalAlign="Center" />
            <PagerStyle BackColor="PaleGoldenrod" ForeColor="DarkSlateBlue" 
                HorizontalAlign="Center" />
            <RowStyle HorizontalAlign="Center" VerticalAlign="Middle" />
            <SelectedRowStyle BackColor="#E49642" ForeColor="GhostWhite" />
            <SortedAscendingCellStyle BackColor="#FAFAE7" />
            <SortedAscendingHeaderStyle BackColor="#DAC09E" />
            <SortedDescendingCellStyle BackColor="#E1DB9C" />
            <SortedDescendingHeaderStyle BackColor="#C2A47B" />
                </asp:GridView>
                        </td>
                    </tr>
            </table>
            </td>
        </tr>
    </table>
</asp:Content>

